#include "stationinfo.h"
#include "ui_stationinfo.h"

StationInfo::StationInfo(QString name, QWidget *parent) :
    QFrame(parent),
    ui(new Ui::StationInfo)
{
    ui->setupUi(this);
    ui->name->setText(name);
    ui->stackedWidget->addWidget(new QLabel(name));
    setExpand(false);
}

StationInfo::~StationInfo()
{
    delete ui;
}

void StationInfo::setExpand(bool expand)
{
    if(expand)
    {
        ui->stackedWidget->setCurrentIndex(0);
        this->resize(184,110);
    }
    else
    {
        ui->stackedWidget->setCurrentIndex(1);
        this->resize(184,35);
    }
}

void StationInfo::on_pushButton_clicked()
{
    emit go(true);
    setExpand(false);
}

void StationInfo::on_pushButton_2_clicked()
{
    emit go(false);
    setExpand(false);
}
